﻿#pragma once

#include "../MirEnvir/Envir.h"
#include <string>
#include <vector>

using namespace Server::MirEnvir;

namespace Server::MirDatabase
{
    class RespawnInfo
    {
    public:
        virtual ~RespawnInfo()
        {
            delete Location;
        }

    protected:
        static Server::MirEnvir::Envir *getEnvir();

    public:
        int MonsterIndex = 0;
        Point *Location;
        unsigned short Count = 0, Spread = 0, Delay = 0, RandomDelay = 0;
        unsigned char Direction = 0;

        std::string RoutePath = std::string::Empty;
        int RespawnIndex = 0;
        bool SaveRespawnTime = false;
        unsigned short RespawnTicks = 0; //leave 0 if not using this system!

        RespawnInfo();
        RespawnInfo(BinaryReader *reader, int Version, int Customversion);

        static RespawnInfo *FromText(const std::string &text);

        void Save(BinaryWriter *writer);

        std::string ToString();
    };

    class RouteInfo
    {
    public:
        Point *Location;
        int Delay = 0;

        virtual ~RouteInfo()
        {
            delete Location;
        }

        static RouteInfo *FromText(const std::string &text);
    };
}
